import request from '@/utils/request'


export function fetchSingleNotice(noticeId) {
    return request({
        url: `/notice/${noticeId}`,
        method: 'get'
    })
}


export function getAllNoticesByPage(pageNum,pageSize){
    return request({
        url:'/notice/allByPage?pageNum='+pageNum+'&pageSize='+pageSize,
        method:'get',
    })
}

export function uploadNotice(data) {
    return request({
        url:'/notice/save',
        method:'post',
        dataType:'json',
        data
    })
}

export function updateNotice(data) {
    return request({
        url:'/notice/update',
        method:'post',
        dataType:'json',
        data
    })
}


export function deleteNotice(noticeId){
    return request({
        url: `/notice/delete/${noticeId}`,
        method:'delete'
    })
}
